//
//  UIImage+ResizingImage.m
//  Salvation
//
//  Created by 高波 on 2018/9/12.
//  Copyright © 2018年 Ouuki. All rights reserved.
//

#import "UIImage+ResizingImage.h"

@implementation UIImage (ResizingImage)

+ (UIImage *)resizingImageWithName:(NSString *)imageName
{
    // 1.创建图片对象
    UIImage *image = [UIImage imageNamed:imageName];
    
    // 2.创建可拉伸的图片
    
    CGFloat imageW = image.size.width;
    CGFloat imageH = image.size.height;
    
    UIImage *newImage = [image resizableImageWithCapInsets:UIEdgeInsetsMake(imageH * 0.5, imageW * 0.5, imageH * 0.5, imageW * 0.5) resizingMode:UIImageResizingModeStretch];
    
    return newImage;
}

@end
